package com.cn.serverline.lineicp.productionLine.enums;

import cn.stylefeng.roses.kernel.rule.constants.RuleConstants;
import cn.stylefeng.roses.kernel.rule.exception.AbstractExceptionEnum;
import lombok.Getter;

/**
 * 产品结构异常信息枚举
 *
 * @author Gmr
 * @since 2024/7/30
 */
@Getter
public enum ProductMixException implements AbstractExceptionEnum {

	CATEGORY_NOT_NULL(RuleConstants.BUSINESS_ERROR_TYPE_CODE + "01", "类别不能为空"),
	NAME_DUPLICATE(RuleConstants.BUSINESS_ERROR_TYPE_CODE + "02", "名称不可重复"),
	ID_NOT_NULL(RuleConstants.BUSINESS_ERROR_TYPE_CODE + "03", "ID不能为空"),
	NOT_EXIST(RuleConstants.BUSINESS_ERROR_TYPE_CODE + "04", "信息不存在"),
	PARENT_NODE_EXIST(RuleConstants.BUSINESS_ERROR_TYPE_CODE + "05", "父节点不存在"),
	CANNOT_BE_TOP_LEVEL(RuleConstants.BUSINESS_ERROR_TYPE_CODE + "06", "子节点不可为顶级"),
	UNKNOWN_PRODUCT_STRUCTURE_TYPE(RuleConstants.BUSINESS_ERROR_TYPE_CODE + "07","未知的产品结构类型"),
	UNKNOWN_PROCESS_STAGE(RuleConstants.BUSINESS_ERROR_TYPE_CODE + "08","未知的工艺阶段"),
	INVALID_ID_EXISTS(RuleConstants.BUSINESS_ERROR_TYPE_CODE + "09","存在无效的ID"),
	CANNOT_BE_DELETED(RuleConstants.BUSINESS_ERROR_TYPE_CODE + "10", "节点下存在工序，请先删除节点下所有工序"),
	CANNOT_ADD_PROCESS_SCHEME(RuleConstants.BUSINESS_ERROR_TYPE_CODE + "11", "类型不可为零组件");

	/**
	 * 错误编码
	 */
	private final String errorCode;

	/**
	 * 提示用户信息
	 */
	private final String userTip;

	ProductMixException(String errorCode, String userTip) {
		this.errorCode = errorCode;
		this.userTip = userTip;
	}
}
